package group.sicher.common.entity;

import group.sicher.common.constant.senum.SexEnum;
import group.sicher.common.constant.senum.StatusEnum;

import javax.persistence.*;
import java.util.Objects;

/**
 * @Auth rock
 * @Date 2019/7/1 21:07
 * @description
 */
@Entity
@Table(name = "wm_ consumer_address")
public class ConsumerAddressEntity {

    private Long id;
    private Long consumerId;
    private String consumerName;
    private SexEnum sex;
    private String mobile;
    private String province;
    private String provinceName;
    private String city;
    private String cityName;
    private String area;
    private String areaName;
    private String longitude;
    private String latitude;
    private String address;
    private String street;
    private Integer tag;
    private StatusEnum defaultSet;
    private Integer status;//TODO 枚举
    private Long createAt;
    private Long updateAt;

       @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "consumer_id", nullable = false)
    public Long getConsumerId() {
        return consumerId;
    }

    public void setConsumerId(Long consumerId) {
        this.consumerId = consumerId;
    }

    @Basic
    @Column(name = "consumer_name", nullable = false, length = 60)
    public String getConsumerName() {
        return consumerName;
    }

    public void setConsumerName(String consumerName) {
        this.consumerName = consumerName;
    }

    @Basic
    @Column(name = "sex", nullable = true)
    public SexEnum getSex() {
        return sex;
    }

    public void setSex(SexEnum sex) {
        this.sex = sex;
    }

    @Basic
    @Column(name = "mobile", nullable = false, length = 20)
    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    @Basic
    @Column(name = "province", nullable = true, length = 60)
    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    @Basic
    @Column(name = "province_name", nullable = true, length = 60)
    public String getProvinceName() {
        return provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    @Basic
    @Column(name = "city", nullable = true, length = 60)
    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    @Basic
    @Column(name = "city_name", nullable = true, length = 60)
    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    @Basic
    @Column(name = "area", nullable = true, length = 60)
    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    @Basic
    @Column(name = "area_name", nullable = true, length = 60)
    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    @Basic
    @Column(name = "longitude", nullable = true, length = 20)
    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    @Basic
    @Column(name = "latitude", nullable = true, length = 20)
    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    @Basic
    @Column(name = "address", nullable = true, length = 255)
    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Basic
    @Column(name = "street", nullable = true, length = 100)
    public String getStreet() {
        return street;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    @Basic
    @Column(name = "tag", nullable = true)
    public Integer getTag() {
        return tag;
    }

    public void setTag(Integer tag) {
        this.tag = tag;
    }

    @Basic
    @Column(name = "default_set", nullable = true)
    public StatusEnum getDefaultSet() {
        return defaultSet;
    }

    public void setDefaultSet(StatusEnum defaultSet) {
        this.defaultSet = defaultSet;
    }

    @Basic
    @Column(name = "status", nullable = true)
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Basic
    @Column(name = "create_at", nullable = true)
    public Long getCreateAt() {
        return createAt;
    }

    public void setCreateAt(Long createAt) {
        this.createAt = createAt;
    }

    @Basic
    @Column(name = "update_at", nullable = true)
    public Long getUpdateAt() {
        return updateAt;
    }

    public void setUpdateAt(Long updateAt) {
        this.updateAt = updateAt;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ConsumerAddressEntity that = (ConsumerAddressEntity) o;
        return id == that.id &&
                consumerId == that.consumerId &&
                Objects.equals(consumerName, that.consumerName) &&
                Objects.equals(sex, that.sex) &&
                Objects.equals(mobile, that.mobile) &&
                Objects.equals(province, that.province) &&
                Objects.equals(provinceName, that.provinceName) &&
                Objects.equals(city, that.city) &&
                Objects.equals(cityName, that.cityName) &&
                Objects.equals(area, that.area) &&
                Objects.equals(areaName, that.areaName) &&
                Objects.equals(longitude, that.longitude) &&
                Objects.equals(latitude, that.latitude) &&
                Objects.equals(address, that.address) &&
                Objects.equals(street, that.street) &&
                Objects.equals(tag, that.tag) &&
                Objects.equals(defaultSet, that.defaultSet) &&
                Objects.equals(status, that.status) &&
                Objects.equals(createAt, that.createAt) &&
                Objects.equals(updateAt, that.updateAt);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, consumerId, consumerName, sex, mobile, province, provinceName, city, cityName, area, areaName, longitude, latitude, address, street, tag, defaultSet, status, createAt, updateAt);
    }
}
